package com.example.a10.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.a10.model.entity.User;
import com.example.a10.model.vo.userVo;

import javax.servlet.http.HttpServletRequest;

/**
* @author 27658
* @description 针对表【user】的数据库操作Service
* @createDate 2023-07-28 14:58:05
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param username 用户账户
     * @param password 用户密码
     * @param checkPassword 校验密码
     * @return 新用户 id
     */
    String userRegister(String username, String password, String checkPassword);

    /**
     * 用户登录
     *
     * @param username  用户账户
     * @param password 用户密码
     * @param request 携带的请求信息
     * @return 脱敏后的用户信息
     */
    userVo userLogin(String username, String password, HttpServletRequest request);

    /**
     * 获取当前登录用户
     *
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    public userVo getLoginUserVO(User user);

    boolean userLogout(HttpServletRequest request);

}
